<template>
  <div id="app">
    <router-view class="router-view"/>
    <context-menu ref="contextmenu"></context-menu>
  </div>
</template>
<script>
import ContextMenu from "@/components/ContextMenu";

const axios = require("axios")
const sjmxData = require("./data/sjmxData.json")
const ajmxDada = require("./data/ajmxData.json");

export default {
  components: { ContextMenu },
  async mounted () {
  }
}

// (async () => {
//   let res
//   for (let i = 0; i < ajmxDada.length; i++) {
//     let ajmxDadaElement = ajmxDada[i]
//     let mxbm = ajmxDadaElement.mxbm
//     res = await axios.post("http://192.168.2.227:8088/ajmx-service/api/model/getModelBaseInfo", {
//       dwbm: "100000",
//       mxbm: mxbm
//     })
//     console.log("res", res)
//     let data
//     if (!i){
//       data = res.data.data[0]
//     }else {
//       data = res[0]
//     }
//     // let data = res.data.data[0]
//     let sjit = sjmxData.find(item => item.sjmxbm === data.sjmxbm)
//     if (sjit) {
//       sjit.ajmxbm = mxbm
//     }
//   }
//   console.log(JSON.stringify(sjmxData))
// })()

</script>

<style lang="scss">
* {
  font-family: Consolas, "微软雅黑";
}

.hidden-divider {
  position: relative;

  &.canhidden {
    background-color: #ccc;
    opacity: 0.5;

    &.el-divider--vertical {
      width: 10px;
      height: 100%;
    }

    &.el-divider--horizontal {
      width: 100%;
      height: 10px;
    }

    &:hover {
      //&::after {
      opacity: 1;
      //}
    }
  }

  //&.canhidden.vertical::after {
  //  position: absolute;
  //  content: '';
  //  height: 100%;
  //  width: 10px;
  //  background-color: #ccc;
  //  display: block;
  //  opacity: 0.5;
  //}
  //
  //&.canhidden.vertical::after {
  //  position: absolute;
  //  content: '';
  //  height: 100%;
  //  width: 10px;
  //  background-color: #ccc;
  //  display: block;
  //  opacity: 0.5;
  //  top: 50%;
  //  transform: translateY(-50%);
  //}

  //&:hover {
  //  &::after {
  //    opacity: 1;
  //  }
  //}
}

.jsoneditor {
  border-color: #ccc !important;

  .jsoneditor-menu {
    background-color: #ccc !important;
    border-bottom-color: #ccc;

    .jsoneditor-poweredBy, .jsoneditor-modes, .jsoneditor-compact {
      display: none;
    }

    .jsoneditor-format {
      width: auto !important;
      text-indent: 26px;
      padding: 0 5px !important;

      &::after {
        content: "格式化";
      }
    }
  }
}

*:focus-visible {
  outline: none;
}

body, html {
  margin: 0;
}

body {
  height: 100vh;
  width: 100vw;
}

.el-tabs {
  height: 100%;

  .el-tabs__content {
    height: calc(100% - 55px);

    .el-tab-pane {
      height: 100%;
      overflow-y: auto;
    }
  }
}

#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #2c3e50;
  height: 100%;

  .router-view {
    height: 100%;
  }

  .bds {
    input, textarea {
      font-family: Consolas, serif;
    }
  }
}

.top-bar {
  margin-left: 10px;
  margin-right: 20px;
  display: flex;
  align-items: center;

  .right {
    flex: 1;
    text-align: right;
  }
}

.list-item {
  user-select: none;
  padding: 10px 10px 10px 20px;
  line-height: 25px;
  display: flex;
  align-items: center;
  border-top: 1px solid #ccc;
  box-sizing: border-box;

  &:nth-child(1) {
    border-top: 0;
  }

  &:hover {
    background-color: aliceblue;
    cursor: pointer;

    .btn-box {
      visibility: visible;
    }
  }

  &.active {
    background-color: #c9d9ea;
    //color: white;
  }

  & ~ .children-box .list-item {
    padding-left: 50px;
  }

  &.over {
    background-color: #79bbff;
    color: white;
  }

  &.over-top {
    box-shadow: 0 -3px 0 0 #79bbff;
  }

  &.over-bottom {
    box-shadow: 0 3px 0 0 #79bbff;
  }

  &.canmove {
    transition-duration: 0.3s;
  }

  .mc-box {
    flex: 1;
    overflow: hidden;

    div {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
  }

  .btn-box {
    display: flex;
    visibility: hidden;

    .btn {
      height: 24px;
      width: 24px;
      display: inline-block;
      background-position: center;
      background-repeat: no-repeat;
      background-size: 18px;

      &:hover {
        background-color: rgba(121, 187, 255, 0.3);
        opacity: .7;
      }

      &.edit-btn {
        background-image: url("~@/assets/svg/edit.svg");
      }

      &.delete-btn {
        background-image: url("~@/assets/svg/delete.svg");
      }
    }
  }
}

.el-divider--vertical {
  height: 100% !important;
}

.deleteBtn {
  color: #fff !important;
  background-color: #f56c6c !important;
  border-color: #f56c6c !important;
}

.trueBtn, .falseBtn {
  border-color: transparent !important;
  background-color: transparent !important;
  height: 32px !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: 90% !important;
  background-image: url("~@/assets/img/true.png") !important;

  &:hover {
    background-color: #ccc !important;
  }
}

.falseBtn {
  background-image: url("~@/assets/img/false.png") !important;
}

.myTree {
  .el-tree-node__content {
    height: 45px;
  }
}
</style>
